import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

// 创建路由器
const router = new VueRouter({
  base: '/app', // 路由基本路径，默认是 / 
  mode: 'history', // 路由模式 hash | history
  routes: [
    {
      path: '/home',
      component: () => import('./views/Home.vue')
    },
    {
      path: '/about',
      component: () => import('./views/About.vue')
    },
    {
      // 通配符，
      path: '*',
      component: () => import('./views/Page404.vue')
    }
  ]
})

// 默认导出路由器
export default router